from django.conf.urls import url
from operation import views

app_name = 'operation'
urlpatterns = [
    url(r'^login/$', views.login),    # 登录
    url(r'^index/$', views.index),   # 后台首页
    url(r'^welcome/$', views.welcome),   # 后台欢迎页

    url(r'^user_list/$',  views.user_list, name='user_list'),  # 用户列表
    url(r'^change_user/(?P<user_id>[0-9]+)/$', views.change_user, name='change_user'),  # 修改用户信息
    url(r'^user_search/$', views.user_search, name='user_search'),  # 搜索用户
    url(r'^user_detail/(?P<user_id>[0-9]+)/$', views.user_detail, name='user_detail'),  # 用户详情
    url(r'^library_list/$', views.library_list, name='library_list'),   # 图书列表
    url(r'^add_library/$', views.add_library, name='add_library'),   # 添加图书
    url(r'^del_library/(?P<book_id>[0-9]+)/$', views.del_library, name='del_library'),   # 删除图书
    url(r'^library_detail/(?P<book_id>[0-9]+)/$', views.library_detail, name='library_detail'),  # 图书详情
    url(r'^search_library', views.search_library, name='search_library'),   # 搜索图书
    url(r'^library_change/(?P<book_id>[0-9]+)/$', views.library_change, name='library_change'),  # 修改图书信息

    url(r'^borrow/(?P<user_id>[0-9]+)/$', views.borrow, name='borrow'),    # 借书
    url(r'^borrow_list/$', views.borrow_list, name='borrow_list'),
    url(r'^return_book/$', views.return_book, name="return_book"),         # 还书

    url(r'^operator_list/$', views.operator_list, name='operator_list'),  # 管理员列表
    url(r'^add_operator/$', views.add_operation, name='add_operator'),    # 添加管理员
    url(r'^del_operator/$', views.del_operation, name='del_operator'),    # 删除管理员
    url(r'^chanage_operator/$', views.change_operator, name='change_operator'),   # 修改管理员信息

]